<?php
class baseclient
{
    protected $clientname;
    public function __construct()
    {
        $this->clientname = get_class($this);
    }
    public function __call($method, $arguments)
    {
        //start unitofwork todo drx
        $uw = new unitofwork();
        $servicename = $this->convertclient2service($this->clientname);
        $res = call_user_func(array(new $servicename, $method), $arguments);
        $uw->commit();
        return $res;
        //run unitofwork
    } 

    public function convertclient2service($clientname)
    {
        $array = explode('client', $clientname);
        $servicename = $array[0].'svc';
        return $servicename;
    }
}
